package com.cloud.order.mapper.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
* (Orders) 实体类
*
* @author zhangxun
* @since 2021-01-17
*/
@Data
@TableName(value = "orders")
public class Orders implements Serializable {
    private static final long serialVersionUID=1L;
    /*** 订单id*/
    @TableId(type = IdType.AUTO)
    private Long id;

    /*** 用户id*/
    @TableField("user_id")
    private Integer userId;

    /*** 订单状态 0未确认，1已确认，2已取消，3无效，4退款*/
    @TableField("orders_status")
    private Integer ordersStatus;

    /*** 支付状态 0未支付 1支付中 2已支付*/
    @TableField("pay_status")
    private Integer payStatus;

    /*** 发货状态 0未发货 1发货中 2已收货*/
    @TableField("ship_status")
    private Integer shipStatus;

    /*** 收货地址*/
    @TableField("address")
    private String address;

    /*** 收货人*/
    @TableField("consignee")
    private String consignee;

    /*** 商品id*/
    @TableField("product_id")
    private Long productId;

    /*** 商品数量*/
    @TableField("product_number")
    private Integer productNumber;

    /*** 商品价格*/
    @TableField("product_price")
    private BigDecimal productPrice;

    /*** 商品总价*/
    @TableField("product_amout")
    private BigDecimal productAmout;

    /*** 运费*/
    @TableField("product_fee")
    private BigDecimal productFee;

    /*** 订单金额*/
    @TableField("order_amout")
    private BigDecimal orderAmout;

    /*** 优惠券id*/
    @TableField("coupon_id")
    private Integer couponId;

    /*** 优惠金额*/
    @TableField("coupon_paid")
    private BigDecimal couponPaid;

    /*** 支付金额*/
    @TableField("pay_amount")
    private BigDecimal payAmount;

    /*** 创建时间*/
    @TableField("create_time")
    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /*** 确认时间*/
    @TableField("confirm_time")
    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime confirmTime;

    /*** 支付时间*/
    @TableField("pay_time")
    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime payTime;

}